<script>
	export default {
		props: {
			tableColumn: {
				type: Array,
				default: () => []
			},
			tableData: {
				type: Array,
				default: () => []
			}
		},
		data() {
			return {
				key: 'value'
			}
		},
		methods: {
			tableColumnClick(e) {
				console.log(e)
			}
		},
		render(h) {
			return (
				// {...{listeners: item.change}}
				<div>
					<el-button
						type="primary"
						size="default"
						onClick={() => {
							this.tableColumnClick('abc')
						}}
					>
						点击
					</el-button>
					<el-table data={this.tableData} border>
						{this.tableColumn.map(item => {
							return (
								<el-table-column
									prop={item.key}
									{...{ attrs: item.attrs }}
									{...{
										scopedSlots: {
											default: scope => {
												return item.render ? item.render(h, scope) : scope.row[item.key]
											}
										}
									}}
								></el-table-column>
							)
						})}
					</el-table>
				</div>
			)
		}
	}
</script>

<style lang="scss" scoped></style>
